package com.kma.summer2012.client.services.CrumbsCatalogOfTools;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.kma.summer2012.client.ExceptionHandling.CrumbsRPCServiceException;
import com.kma.summer2012.shared.model.UICrumbsToolItem;

import java.util.List;

@RemoteServiceRelativePath("CrumbsCatalogOfToolsService")
public interface CrumbsCatalogOfToolsService extends RemoteService {

    List<UICrumbsToolItem> getAllTools() throws CrumbsRPCServiceException;

    void saveTool(UICrumbsToolItem uiTool) throws CrumbsRPCServiceException;

    void deleteAllTool(List<UICrumbsToolItem> selectedTools) throws CrumbsRPCServiceException;

    UICrumbsToolItem getByNameTool(String name) throws CrumbsRPCServiceException;


    public static class App {
        private static final CrumbsCatalogOfToolsServiceAsync ourInstance = (CrumbsCatalogOfToolsServiceAsync) GWT.create(CrumbsCatalogOfToolsService.class);

        public static CrumbsCatalogOfToolsServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
